<template>
  <el-dialog
    class="dialogStyle"
    style="width: 75vw"
    :title="'104-105皮带参数'"
    v-model="visible"
  >
    <div class="container">
      <div class="panel">
        <div class="panel-header">
          <h2>104-105皮带参数</h2>
          <span class="note"
            ><span class="note-highlight">注:</span>
            以下温度单位为:℃，振动单位为:mm/s</span
          >
        </div>

        <div class="table-container">
          <el-row class="header-row">
            <el-col :span="4">设备名称</el-col>
            <el-col :span="2">参数</el-col>
            <el-col :span="4">设备名称</el-col>
            <el-col :span="2">参数</el-col>
            <el-col :span="4">设备名称</el-col>
            <el-col :span="2">参数</el-col>
            <el-col :span="4">设备名称</el-col>
            <el-col :span="2">参数</el-col>
          </el-row>
          <el-row>
            <el-col :span="4">1-B 104电滚筒（卸载）内侧振动</el-col>
            <el-col :span="2">xxx</el-col>
            <el-col :span="4">1-B 104电滚筒（卸载）内侧温度</el-col>
            <el-col :span="2">xxx</el-col>
            <el-col :span="4">3-B 104机尾支撑滚筒内侧振动</el-col>
            <el-col :span="2">xxx</el-col>
            <el-col :span="4">3-B 104机尾支撑滚筒内侧温度</el-col>
            <el-col :span="2">xxx</el-col>
          </el-row>
          <el-row>
            <el-col :span="4">1-A 104电滚筒（卸载）外侧振动</el-col>
            <el-col :span="2">xxx</el-col>
            <el-col :span="4">1-A 104电滚筒（卸载）外侧温度</el-col>
            <el-col :span="2">xxx</el-col>
            <el-col :span="4">3-A 104机尾支撑滚筒外侧振动</el-col>
            <el-col :span="2">xxx</el-col>
            <el-col :span="4">3-A 104机尾支撑滚筒外侧温度</el-col>
            <el-col :span="2">xxx</el-col>
          </el-row>
          <el-row>
            <el-col :span="4">2-B 104卸载支撑滚筒内侧振动</el-col>
            <el-col :span="2">xxx</el-col>
            <el-col :span="4">2-B 104卸载支撑滚筒内侧温度</el-col>
            <el-col :span="2">xxx</el-col>
            <el-col :span="4">4-B 105机尾滚筒内侧振动</el-col>
            <el-col :span="2">xxx</el-col>
            <el-col :span="4">4-B 105机尾滚筒内侧温度</el-col>
            <el-col :span="2">xxx</el-col>
          </el-row>
          <el-row>
            <el-col :span="4">2-A 104卸载支撑滚筒外侧振动</el-col>
            <el-col :span="2">xxx</el-col>
            <el-col :span="4">2-A 104卸载支撑滚筒外侧温度</el-col>
            <el-col :span="2">xxx</el-col>
            <el-col :span="4">3-B 105机尾支撑滚筒内侧振动</el-col>
            <el-col :span="2">xxx</el-col>
            <el-col :span="4">3-B 105机尾支撑滚筒内侧温度</el-col>
            <el-col :span="2">xxx</el-col>
          </el-row>
          <el-row>
            <el-col :span="4">4-B 104机尾滚筒内侧振动</el-col>
            <el-col :span="2">xxx</el-col>
            <el-col :span="4">4-B 104机尾滚筒内侧温度</el-col>
            <el-col :span="2">xxx</el-col>
            <el-col :span="4">3-A 105机尾支撑滚筒外侧振动</el-col>
            <el-col :span="2">xxx</el-col>
            <el-col :span="4">3-A 105机尾支撑滚筒外侧温度</el-col>
            <el-col :span="2">xxx</el-col>
          </el-row>
          <el-row>
            <el-col :span="4">104张紧泵站电机振动</el-col>
            <el-col :span="2">xxx</el-col>
            <el-col :span="4">104张紧泵站电机温度</el-col>
            <el-col :span="2">xxx</el-col>
            <el-col :span="4">104循环水泵电机温度</el-col>
            <el-col :span="2">xxx</el-col>
            <el-col :span="4">105循环水泵电机温度</el-col>
            <el-col :span="2">xxx</el-col>
          </el-row>
          <el-row>
            <el-col :span="4">4-A 105机尾滚筒外侧振动</el-col>
            <el-col :span="2">xxx</el-col>
            <el-col :span="4">4-A 105机尾滚筒外侧温度</el-col>
            <el-col :span="2">xxx</el-col>
            <el-col :span="4">104冷却风扇电机温度</el-col>
            <el-col :span="2">xxx</el-col>
            <el-col :span="4">105冷却风扇电机温度</el-col>
            <el-col :span="2">xxx</el-col>
          </el-row>
          <el-row>
            <el-col :span="4">4-A 104机尾滚筒外侧振动</el-col>
            <el-col :span="2">xxx</el-col>
            <el-col :span="4">4-A 104机尾滚筒外侧温度</el-col>
            <el-col :span="2">xxx</el-col>
            <el-col :span="4">105张紧泵站电机振动</el-col>
            <el-col :span="2">xxx</el-col>
            <el-col :span="4">105张紧泵站电机温度</el-col>
            <el-col :span="2">xxx</el-col>
          </el-row>
          <el-row>
            <el-col :span="4">1-A 105电滚筒（卸载）外侧振动</el-col>
            <el-col :span="2">xxx</el-col>
            <el-col :span="4">1-A 105电滚筒（卸载）外侧温度</el-col>
            <el-col :span="2">xxx</el-col>
            <el-col :span="4">1-B 105电滚筒（卸载）内侧振动</el-col>
            <el-col :span="2">xxx</el-col>
            <el-col :span="4">1-B 105电滚筒（卸载）内侧温度</el-col>
            <el-col :span="2">xxx</el-col>
          </el-row>
          <el-row>
            <el-col :span="4">2-A 105卸载支撑滚筒外侧振动</el-col>
            <el-col :span="2">xxx</el-col>
            <el-col :span="4">2-A 105卸载支撑滚筒外侧温度</el-col>
            <el-col :span="2">xxx</el-col>
            <el-col :span="4">2-B 105卸载支撑滚筒内侧振动</el-col>
            <el-col :span="2">xxx</el-col>
            <el-col :span="4">2-B 105卸载支撑滚筒内侧温度</el-col>
            <el-col :span="2">xxx</el-col>
          </el-row>
          <el-row>
            <el-col :span="4">闸板液压站电机温度</el-col>
            <el-col :span="2">xxx</el-col>
            <el-col :span="4"></el-col>
            <el-col :span="2"></el-col>
            <el-col :span="4"></el-col>
            <el-col :span="2"></el-col>
            <el-col :span="4"></el-col>
            <el-col :span="2"></el-col>
          </el-row>
        </div>
      </div>
    </div>
  </el-dialog>
</template>

<script setup lang="ts">
import { ref, reactive, nextTick } from "vue";
import { act, createWebSocket } from "@/utils/websocket"; //引入websocket
import {
  useTagResults,
  useTagResultsFromSource,
} from "@/utils/useTagResults.ts";

// 定义变量内容
const visible = ref(false);
// 打开弹窗
const openDialog = () => {
  visible.value = true; // 打开弹窗
};

// 暴露变量
defineExpose({
  openDialog,
});
</script>

<style scoped lang="scss">
.dialogStyle {
  .container {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  .panel {
    display: flex;
    flex-direction: column;
    background-color: var(--el-bg-color);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  }

  .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: var(--el-color-primary-light-9);
    border-bottom: 1px solid var(--el-border-color-light);

    h2 {
      margin: 0;
      font-size: 16px;
      font-weight: 500;
      color: var(--el-text-color-primary);
    }

    .note {
      font-size: 14px;
      color: var(--el-text-color-regular);

      .note-highlight {
        color: var(--el-color-danger);
        font-weight: 500;
      }
    }
  }

  .table-container {
    overflow-x: auto;
    border: 1px solid var(--el-border-color-light);
  }

  .header-row {
    .el-col {
      background-color: var(--el-fill-color) !important;
      font-weight: 500;
      color: var(--el-text-color-primary);
      padding: 8px 5px;
      text-align: center;
      font-size: 13px;
    }
  }

  .el-row {
    .el-col {
      border: 1px solid var(--el-border-color-lighter);
      padding: 8px 5px;
      text-align: center;
      font-size: 12px;
      color: var(--el-text-color-regular);
      min-height: 36px;
      display: flex;
      align-items: center;
      justify-content: center;

      &:first-child,
      &:nth-child(3),
      &:nth-child(5),
      &:nth-child(7) {
        font-weight: 500;
        color: var(--el-text-color-primary);
        background-color: var(--el-fill-color-lighter);
      }
    }
  }
}
</style>
